projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6258b04
)
Fix memory leak in mmc_read()
author
Wolfgang Denk
<
[email protected]
>
Thu, 11 Mar 2010 22:35:43 +0000
(23:35 +0100)
committer
Wolfgang Denk
<
[email protected]
>
Thu, 11 Mar 2010 22:35:43 +0000
(23:35 +0100)
There is be a path through mmc_read in drivers/mmc/mmc.c where
malloc'd memory is not freed before exiting mmc_read: it occurs if
mmc_set_blocklen() returns a non-zero value.
Reported-by: Quentin Armitage <
[email protected]
>
Signed-off-by: Wolfgang Denk <
[email protected]
>
drivers/mmc/mmc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/mmc.c
b/drivers/mmc/mmc.c
index 367922579cb1731c604ed65300e5d303e02beac2..cf4ea161b964ab36c8b4da95d9f3d209d9ca66be 100644
(file)
--- a/
drivers/mmc/mmc.c
+++ b/
drivers/mmc/mmc.c
@@
-179,7
+179,7
@@
int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size)
err = mmc_set_blocklen(mmc, mmc->read_bl_len);
if (err)
-
return er
r;
+
goto free_buffe
r;
for (i = startblock; i <= endblock; i++) {
int segment_size;